<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "user_code".
 *
 * @property int $id
 * @property string $phone 手机号
 * @property int $code
 * @property string $create_time
 * @property int $validity_time 有效期
 */
class UserCode extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'user_code';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['phone', 'code', 'create_time'], 'required'],
            [['code', 'validity_time'], 'integer'],
            [['create_time'], 'safe'],
            [['phone'], 'string', 'max' => 20],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'phone' => 'Phone',
            'code' => 'Code',
            'create_time' => 'Create Time',
            'validity_time' => 'Validity Time',
        ];
    }
}
